package indi.yuluo.service.impl;

import com.fasterxml.jackson.databind.util.BeanUtil;
import indi.yuluo.dao.ProblemMapper;
import indi.yuluo.entity.DTO.ProblemDiscussDto;
import indi.yuluo.entity.problem.Problem;
import indi.yuluo.service.DiscussService;
import indi.yuluo.service.ProblemService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/**
 * @Author: yuluo
 * @CreateTime: 2022-08-19  22:06
 * @Description: TODO
 */

@Service
@Slf4j
public class ProblemServiceImpl implements ProblemService {

    @Resource
    private ProblemMapper problemMapper;

    /**
     * 获取数据库中的题目信息
     * @return 包含题目信息的list集合
     */
    @Override
    public List<Problem> getQuestionInfo() {

        return problemMapper.getProblem();
    }

    /**
     * 通过题目id获取题目信息
     * @param id
     * @return
     */
    @Override
    public Problem getProblemById(Long id) {
        return problemMapper.getProblemById(id);
    }
}
